<?php
   header("content-type:text/html;charset=utf8");

   $pdo = new PDO("mysql:host=127.0.0.1;dbname=brand;charset=utf8","root","root");

   $sql = "SELECT * FROM goods";

   $data = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
	<title></title>
</head>
<body>
<center>
请输入城市:<input type="text" name="city" id="city">
</center>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
	$("#city").blur(function(){
       var city = $(this).val();
       $.ajax({
       	  url:"list_do.php",
       	  data:{city:city},
       	  dataType:"json",
       	  type:"post",
       	  success:function(res){
       	  	
       	  	 console.log(res);
       	  }
       });
	});
</script>